<include file="Public/head"/>
<body class="no-skin">
<include file="Public/header"/>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>

    <include file="Public/sidebar"/>
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <include file="Public/breadcrumbs"/>

            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">
                <include file="Public/set"/>
                
                <!-- /section:settings.box -->
                <div class="row">
                    <div class="col-xs-12">
                     <div class="cf">                          
                                <a class="btn btn-info" href="{:U('add')}" value="">新增</a>
                        </div>
                        <div class="space-4"></div>
                        <!-- PAGE CONTENT BEGINS -->
                        <table class="table table-striped table-bordered">
                            <thead>
                            <tr>
                                <th class="col-xs-1">ID</th>
                                <th class="col-xs-3">单页名称</th>
                                <th class="col-xs-2">所属分类</th>
                                <th class="col-xs-1">排序</th>
                                <th class="col-xs-2">添加时间</th>
                                <th class="col-xs-2">操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <volist name="pages" id="val">
                            <tr>
                            <td>{$val['id']}</td>
                            <td>{$val['title']}</td>
                            <td>{$val['name']}</td>
                            <td><input name="o" class="inputorder" type="number" value="{$val['o']}"val="'.$val['id'].'"/></td>
                            <td>{$val['t']}</td>
                            <td>
                                <a class="blue" href="{:U('edit',array('id'=>$val['id']))}" title="编辑分类"><i class="ace-icon fa fa-plus-circle bigger-100"></i>编辑</a>&nbsp;&nbsp;
                                 
                                 <a href="javascript:;" val="{:U('del',array('id'=>$val['id']))}" class="del"><i class="ace-icon fa fa-trash-o bigger-100 red"></i>删除</a>
                            </td>
                            </tr>
                            </volist>
                            </tbody>
                        </table>
                        <!-- PAGE CONTENT ENDS -->
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->
    <include file="Public/footer"/>
</div><!-- /.main-container -->
<include file="Public/footerjs"/>
<!-- inline scripts related to this page -->
<script type="text/javascript">
    $(function () {
        $(".inputorder").change(function () {
            var id = $(this).attr('val');
            var o = $(this).val();
            if (id != o) {
                $.post("{:U('update',array('act'=>'order'))}", {id: id, o: o}, function (data) {
                    if (data == 1) {
                        window.location.reload(true);
                    }
                }
            )
                ;
            }
        })
        $(".del").click(function () {
            var url = $(this).attr('val');
            bootbox.confirm({
                title: "系统提示",
                message: "是否要删除该单页？",
                callback: function (result) {
                    if (result) {
                        window.location.href = url;
                    }
                },
                buttons: {
                    "cancel": {"label": "取消"},
                    "confirm": {
                        "label": "确定",
                        "className": "btn-danger"
                    }
                }
            });
        });
    })
</script>

</body>
</html>
